<UserControl x:Class="StockTraderRI.Modules.Position.Orders.OrderCompositeView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:toolkit="clr-namespace:Microsoft.Windows.Controls;assembly=Microsoft.Windows.Controls" 
    xmlns:Converters="clr-namespace:StockTraderRI.Infrastructure.Converters;assembly=StockTraderRI.Infrastructure">
    <UserControl.Resources>
        <Style x:Key="HeaderedContentControlStyle1" TargetType="toolkit:HeaderedContentControl">
            <Setter Property="Foreground" Value="#FF000000"/>
            <Setter Property="HorizontalAlignment" Value="Stretch" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="toolkit:HeaderedContentControl">
                        <StackPanel>
                            <ContentPresenter Cursor="{TemplateBinding Cursor}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}"/>
                            <ContentPresenter Cursor="{TemplateBinding Cursor}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                        </StackPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Converters:TransactionTypeToStringConverter x:Key="transactionTypeToStringConverter" />
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <Border Padding="5,5,5,5" BorderBrush="#77000000" BorderThickness="1,1,1,1" Margin="0,0,0,10" CornerRadius="12,12,12,12">
            <toolkit:HeaderedContentControl x:Name="HeaderedControl" BorderThickness="2,1,2,1" Style="{StaticResource HeaderedContentControlStyle1}" Content="{Binding OrderDetailsView}" >
                <toolkit:HeaderedContentControl.Header>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="1.5*" />
                        </Grid.ColumnDefinitions>
                        <StackPanel Grid.Row="0" Grid.Column="0" Margin="10,0,0,12" Orientation="Horizontal">
                            <TextBlock Text="{Binding Converter={StaticResource transactionTypeToStringConverter}, Path=TransactionInfo.TransactionType}" Style="{StaticResource TextBlockSectionTitle}" />
                            <TextBlock Text="{Binding HeaderInfo}" Style="{StaticResource TextBlockSectionTitle}" />
                        </StackPanel>
                        <ContentControl HorizontalAlignment="Right" Grid.Row="0" Grid.Column="1" Content="{Binding OrderCommandsView}" />
                    </Grid>
                </toolkit:HeaderedContentControl.Header>
            </toolkit:HeaderedContentControl>
        </Border>
    </Grid>
</UserControl>
